package group.sicher.common.entity;

import group.sicher.common.constant.senum.PayStatusEnum;

import javax.persistence.*;
import java.util.Objects;

/**
 * @Auth rock
 * @Date 2019/7/1 21:08
 * @description
 */
@Entity
@Table(name = "wm_pay")
public class PayEntity {

    private Long id;
    private String orderCode;
    private Long userId;
    private Long shopId;
    private String totalMoney;
    private PayStatusEnum status;
    private Long createAt;
    private Long dealAt;

       @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "order_code", nullable = true, length = 50)
    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    @Basic
    @Column(name = "user_id", nullable = true)
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "shop_id", nullable = true)
    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    @Basic
    @Column(name = "total_money", nullable = true, length = 10)
    public String getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(String totalMoney) {
        this.totalMoney = totalMoney;
    }

    @Basic
    @Column(name = "status", nullable = true)
    public PayStatusEnum getStatus() {
        return status;
    }

    public void setStatus(PayStatusEnum status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_at", nullable = true)
    public Long getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Long createAt) {
        this.createAt = createAt;
    }

    @Basic
    @Column(name = "deal_at", nullable = true)
    public Long getDealAt() {
        return dealAt;
    }

    public void setDealAt(Long dealAt) {
        this.dealAt = dealAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PayEntity that = (PayEntity) o;
        return id == that.id &&
                Objects.equals(orderCode, that.orderCode) &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(shopId, that.shopId) &&
                Objects.equals(totalMoney, that.totalMoney) &&
                Objects.equals(status, that.status) &&
                Objects.equals(createAt, that.createAt) &&
                Objects.equals(dealAt, that.dealAt);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, orderCode, userId, shopId, totalMoney, status, createAt, dealAt);
    }
}
